import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import jwtConfig from '../../config/jwt.config';
import { WorksService } from './works.service';
import { WorksController } from './works.controller';
import { Work } from './entities/work.entity';
import { Like } from './entities/like.entity';
import { Collection } from './entities/collection.entity';
import { User } from '../auth/entities/user.entity';

@Module({
  imports: [
    TypeOrmModule.forFeature([Work, Like, Collection, User]),
    jwtConfig, // 导入 JWT 模块，使 AuthGuard 可以正常工作
  ],
  controllers: [WorksController],
  providers: [WorksService],
  exports: [WorksService],
})
export class WorksModule {}
